UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'abLs3RBAZDlfK0oB4L+hVz7CgtcM59os9QUVuQDmkds=' 
WHERE 
  key_id = '72ff06c55cda3e0399cff458e49578a46a65ee36d8a9f51ad7ce7511cc992642' 
  AND (
    token = 'abLs3RBAZDlfK0oB4L+hVz7CgtcM59os9QUVuQDmkds=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024