UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'd0e0H9eLQSq6YHZxR9hw8Krc8qLEU9tUQb2wKRlXoC4=' 
WHERE 
  key_id = '4053d3b8da95fd5fdc07530de0b3f3be73704f278366a366208be4bf82a903ad' 
  AND (
    token = 'd0e0H9eLQSq6YHZxR9hw8Krc8qLEU9tUQb2wKRlXoC4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020