UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+GffycI6tXwKCguP2QeOvJsb4TW9D3bhuobOKeROHX8=' 
WHERE 
  key_id = '1f7d4b27da903d6335aea6da21aedc558f0413590c53b17957a369d4abb4890b' 
  AND (
    token = '+GffycI6tXwKCguP2QeOvJsb4TW9D3bhuobOKeROHX8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033