UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hneOf6LGqFYFyfneMolPdNNd/5DmzEpxGkWkjcEElKc=' 
WHERE 
  key_id = '47a7a28e9308b2553a8af0839818ef1113b567963c5d99ef286a203c9938f339' 
  AND (
    token = 'hneOf6LGqFYFyfneMolPdNNd/5DmzEpxGkWkjcEElKc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052