UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'keVCVJA0veJo1eS/aGgtJTE0Kx5H5IKrbLi/WDhAOnU=' 
WHERE 
  key_id = '29719e8bb015666ddcfbb604064879deb3ad0fe4ce7846db70dd0622f5497e0c' 
  AND (
    token = 'keVCVJA0veJo1eS/aGgtJTE0Kx5H5IKrbLi/WDhAOnU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017