UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3omztIYOpa+E1NyWY0EeuwVKbiFgjS77iS7aTlz4gfQ=' 
WHERE 
  key_id = '10dba2c2824a99d0a6d6a7b26e85552ceb7d9169e63bf8ef261a78438fe9129e' 
  AND (
    token = '3omztIYOpa+E1NyWY0EeuwVKbiFgjS77iS7aTlz4gfQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018