UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0HZV7y33uZ4CHzjd7pFdFsKU3EhTzCUMB2rEP1gN/l0=' 
WHERE 
  key_id = 'a13e39ec2774abe77664fc78ec05e116807ea1ac4a281f37232cd688c221f67c' 
  AND (
    token = '0HZV7y33uZ4CHzjd7pFdFsKU3EhTzCUMB2rEP1gN/l0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046