UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'INhxAs9ySgT5CM/mALi8nWzlXLqT87PvmnakqHiWL5M=' 
WHERE 
  key_id = '735b9627a083c314ba02a441ab9b9b0c41fb0ae8357bc4d2a85fbe794bd3693a' 
  AND (
    token = 'INhxAs9ySgT5CM/mALi8nWzlXLqT87PvmnakqHiWL5M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039