UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VDP/Mkf9GjPxHEhu/uB7Ak69usW/SR1YPVIhWPbkEaw=' 
WHERE 
  key_id = '54e1c95ce1b3d0f9ed4e5e5ec013750637eb4a65c79c908d680f34aad66a7289' 
  AND (
    token = 'VDP/Mkf9GjPxHEhu/uB7Ak69usW/SR1YPVIhWPbkEaw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037