UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vThni16/d1F7yhfE58qJZWedz/2jRX0eiv0ALNaGrG8=' 
WHERE 
  key_id = '4d0e7885568ce7adf2b87dcdbbf9c6ff6fc746b1fdf13c5a932be0a6a912325a' 
  AND (
    token = 'vThni16/d1F7yhfE58qJZWedz/2jRX0eiv0ALNaGrG8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043