UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1HNCwH0PWIr9sniBj6+O5W8uz4MP1BZmlXJoIHBFj4U=' 
WHERE 
  key_id = 'c225e3c0ff508db4242d8bb45db6fc00ea8be62f687359b64d51a7d2f24a1c59' 
  AND (
    token = '1HNCwH0PWIr9sniBj6+O5W8uz4MP1BZmlXJoIHBFj4U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019