UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gxx4l5qGG7KMQhQ5HgXWHQDJzCYLGKAzzx/eLx13IDA=' 
WHERE 
  key_id = 'bb36db769b8e4e0f8fc88ee60042823277ea2c3d7dda7fb1022fac0ad25154ae' 
  AND (
    token = 'gxx4l5qGG7KMQhQ5HgXWHQDJzCYLGKAzzx/eLx13IDA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029