UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eT875pRuV4y00ZdIvkEPH036thwyT2z+aTAcgwh1/9A=' 
WHERE 
  key_id = '6da12c5250df5d3e83604c209792fe966f6e28bb818cdd47da80d07389f4a600' 
  AND (
    token = 'eT875pRuV4y00ZdIvkEPH036thwyT2z+aTAcgwh1/9A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024