UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Pxs/0zUBj9Y1ms0AuOoJpNwW/pev5d/pxqVpS0Qo7Mc=' 
WHERE 
  key_id = '8a184275e74faad5b5fc21e6d4b191d4099a805f51caf1ea921b72d4da44df56' 
  AND (
    token = 'Pxs/0zUBj9Y1ms0AuOoJpNwW/pev5d/pxqVpS0Qo7Mc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036