UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LSxln5NNXhf8MFqtVlNA2bfW+C4AVzXefGFEPrfFIEw=' 
WHERE 
  key_id = 'b5acd9baf2f808bc0ba342f1db82577d5c5a7fe53fd7a96589cbd993818f4d4a' 
  AND (
    token = 'LSxln5NNXhf8MFqtVlNA2bfW+C4AVzXefGFEPrfFIEw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041