UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UYlVw7+7z9dfp62pMXIs1loGML1RaStsjaT5X9uT1CA=' 
WHERE 
  key_id = 'f962bb35dd389c96898e8092f9a0b0b6efc34f69d66054ac51fe21fd2375afe4' 
  AND (
    token = 'UYlVw7+7z9dfp62pMXIs1loGML1RaStsjaT5X9uT1CA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024