UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gX1Tp9kzyqMGh//uvjdf4gM8NId6gyVf3wquKFTZFug=' 
WHERE 
  key_id = 'f271401740e47ab25e92472d8f2262d76cb57257a0932f5ae0a8ba097d2f2b70' 
  AND (
    token = 'gX1Tp9kzyqMGh//uvjdf4gM8NId6gyVf3wquKFTZFug=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038