UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tIu4uDqYeC9jNWJPW1pXOrqzWSt411cVgwlVtZwRU3Q=' 
WHERE 
  key_id = 'b6135fada8ed8e62b49f26905e9d9f860e01ce642c23a79c6c65ce582ecb4476' 
  AND (
    token = 'tIu4uDqYeC9jNWJPW1pXOrqzWSt411cVgwlVtZwRU3Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030