UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rM3mpoWu4cuLY85Ku2kMNGobTTyQmmg3vXQ9YDM1jAA=' 
WHERE 
  key_id = 'adc64980ddb059e44b143b5b8f60ce5c14913e33bc43d4f68239f28fca8dbfa3' 
  AND (
    token = 'rM3mpoWu4cuLY85Ku2kMNGobTTyQmmg3vXQ9YDM1jAA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051