UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2VFj4uNsxp02fNav7Jzs92EcdHsPFzC5z293KR7qz4Q=' 
WHERE 
  key_id = 'c99b7a78c30700a425f94ffc59c7d8d7ffbdcedb55b1d2c33c97c301f3c61034' 
  AND (
    token = '2VFj4uNsxp02fNav7Jzs92EcdHsPFzC5z293KR7qz4Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037