UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9T/alU6Cgiss/1gBleJxr6iXqsLRP2Tflg7ATq6AUH0=' 
WHERE 
  key_id = '33ff227c264d398be63febf940c14e6751ae314a1d0f29a7dd7eac45236ca3e2' 
  AND (
    token = '9T/alU6Cgiss/1gBleJxr6iXqsLRP2Tflg7ATq6AUH0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023