UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Fdnrr8dBjcEMP2tnvMQn+2Z2srsqwFjRWNnT5OBtzZI=' 
WHERE 
  key_id = 'ef902156a724c5a52619416ea58a2057d0382c3fbeb8d1b0f9d26233350d2bb9' 
  AND (
    token = 'Fdnrr8dBjcEMP2tnvMQn+2Z2srsqwFjRWNnT5OBtzZI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038