UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'htdjl4BzNVKiPlZ838LoVmUh6nYopP4pqXZ6G1hZ5ow=' 
WHERE 
  key_id = 'e693bcd09b0c6329f5d10e5f6c36d120ab30c3133584fb768990d2ae9ebc5972' 
  AND (
    token = 'htdjl4BzNVKiPlZ838LoVmUh6nYopP4pqXZ6G1hZ5ow=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028