UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UIM9GQrYEHf5g8cbYBJlcFDVymoeoNNUMrlb5snt9OA=' 
WHERE 
  key_id = '0b8deea442a0f295aca8a9cc8e13e5bce3f8e3c5a339552f2bbe6a634e9f2471' 
  AND (
    token = 'UIM9GQrYEHf5g8cbYBJlcFDVymoeoNNUMrlb5snt9OA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028