UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nuGs5xiojZ4e3/gmI5xpT5lZMADXMundd2LQnafn3dA=' 
WHERE 
  key_id = 'ece494b3164bf9d8aa1e6df288d6b0f1fb77fd54e06d10db8af3608f28a4ec6a' 
  AND (
    token = 'nuGs5xiojZ4e3/gmI5xpT5lZMADXMundd2LQnafn3dA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024