UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UJnQUS4gLSImuhJyybn8GHTNZwl1k5/qyRnIf2AlTRY=' 
WHERE 
  key_id = 'ce72dd7fa1d95d8b067bf20f10247ac949823ff23ada2c1420d7c25478724102' 
  AND (
    token = 'UJnQUS4gLSImuhJyybn8GHTNZwl1k5/qyRnIf2AlTRY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036