UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l9cX1QeQmCmzQqi7nfvL7lgL/Ka8Hm9lljmp197wH6A=' 
WHERE 
  key_id = 'f00d27e6e306d3cb4be352ef42d6a74ddb72c41c05179cd9b6583e3646c9f9d5' 
  AND (
    token = 'l9cX1QeQmCmzQqi7nfvL7lgL/Ka8Hm9lljmp197wH6A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059