UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G2VoHxTHQrIL+Gmfo5Xe6Q1y87DzJO8tIFjsqr7E+AI=' 
WHERE 
  key_id = '477341e9c57ec9a835d0384de62af724fc56da6f6e2dcaeb356fee02463a6feb' 
  AND (
    token = 'G2VoHxTHQrIL+Gmfo5Xe6Q1y87DzJO8tIFjsqr7E+AI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030