UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vAczQcMNBG1io5ZgjXvR6ZN/1NWDZQeD/bISsWVoPk4=' 
WHERE 
  key_id = '2d8026e2baf78ac70a3f66bde127f27c5bb4e18a31be3afe2dbc73237b1fb06e' 
  AND (
    token = 'vAczQcMNBG1io5ZgjXvR6ZN/1NWDZQeD/bISsWVoPk4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060